package com.wp.module.wpWallpaperList.service.impl;

import com.github.f4b6a3.uuid.alt.GUID;
import com.wp.common.utils.DateUtils;
import com.wp.common.utils.SecurityUtils;
import com.wp.module.wpWallpaperList.domain.WpWallpaperList;
import com.wp.module.wpWallpaperList.mapper.WpWallpaperListMapper;
import com.wp.module.wpWallpaperList.service.IWpWallpaperListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 壁纸列Service业务层处理
 * 
 * @author wp
 * @date 2025-02-25
 */
@Service
public class WpWallpaperListServiceImpl implements IWpWallpaperListService
{
    @Autowired
    private WpWallpaperListMapper wpWallpaperListMapper;

    /**
     * 查询壁纸列
     * 
     * @param id 壁纸列主键
     * @return 壁纸列
     */
    @Override
    public WpWallpaperList selectWpWallpaperListById(String id)
    {
        return wpWallpaperListMapper.selectWpWallpaperListById(id);
    }

    /**
     * 查询壁纸列列表
     * 
     * @param wpWallpaperList 壁纸列
     * @return 壁纸列
     */
    @Override
    public List<WpWallpaperList> selectWpWallpaperListList(WpWallpaperList wpWallpaperList)
    {
        return wpWallpaperListMapper.selectWpWallpaperListList(wpWallpaperList);
    }

    /**
     * 新增壁纸列
     * 
     * @param wpWallpaperList 壁纸列
     * @return 结果
     */
    @Override
    public int insertWpWallpaperList(WpWallpaperList wpWallpaperList)
    {
        wpWallpaperList.setCreateTime(DateUtils.getNowDate());
        wpWallpaperList.setCreateBy(SecurityUtils.getUserId().toString());
        wpWallpaperList.setId(GUID.v7().toUUID().toString().replace("-", ""));
        return wpWallpaperListMapper.insertWpWallpaperList(wpWallpaperList);
    }

    /**
     * 修改壁纸列
     * 
     * @param wpWallpaperList 壁纸列
     * @return 结果
     */
    @Override
    public int updateWpWallpaperList(WpWallpaperList wpWallpaperList)
    {
        wpWallpaperList.setUpdateTime(DateUtils.getNowDate());
        wpWallpaperList.setUpdateBy(SecurityUtils.getUserId().toString());
        return wpWallpaperListMapper.updateWpWallpaperList(wpWallpaperList);
    }

    /**
     * 批量删除壁纸列
     * 
     * @param ids 需要删除的壁纸列主键
     * @return 结果
     */
    @Override
    public int deleteWpWallpaperListByIds(String[] ids)
    {
        return wpWallpaperListMapper.deleteWpWallpaperListByIds(ids);
    }

    /**
     * 删除壁纸列信息
     * 
     * @param id 壁纸列主键
     * @return 结果
     */
    @Override
    public int deleteWpWallpaperListById(String id)
    {
        return wpWallpaperListMapper.deleteWpWallpaperListById(id);
    }
}
